package a02_Interit.OverwriteToString;

/**
 * @Author quan
 * @Description 学生类：在这个里面对ToString方法重写
 * @Date 2023/3/1 14:04
 */
public class Student {
    private String name;
    private int age;
    private String sex;
    public Student(){};
    public Student(String name,int age, String sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
    };
    //重写ToString方法
    @Override
    public String toString(){
        String str = "姓名为："+this.name+",年龄为："+this.age+"性别为："+this.sex;
        return str;
    }

}
